from typing import List
class Solution:
    def minMoves(self, nums: List[int]) -> int:
        max_ = max(nums)
        return sum(abs(x - max_) for x in nums)